#include <syscallk.h>
#include <sbi.h>
#include <proc.h>

extern struct task_struct* current;       

uint64 sys_write(unsigned int fd, const char* buf, uint64 count){
    if(fd == 1){
        for(int i = 0; i < count; i++){
            char ch = buf[i];
            sbi_ecall(SBI_PUTCHAR, 0, ch, 0, 0, 0, 0, 0);
        }
    }
}

uint64 sys_getpid(){
    return current->pid;
}